
#include "Peripherals.h"

#include "RGB.h"

static uint32_t c = WHITE;
void xmit_spi(BYTE);

void Routine() {
//	xmit_spi(0);
//	DebugLedToggle();
	
	updateColor();
	InterpolateColor();
	if(checkDone()){
		if (c == BLACK)
		{
			c = WHITE;		
		}
		else	
		{
			c = BLACK;
	    }
		setFutureColor(c);
	}
}


ISR(TIMER3_COMPA_vect){
    Routine();
}

//ISR(TIM2_COMPB_vect){
//    AudioRoutine();
//}
int main (void)
{
	setupPeripherals();
	testLED();
	setFutureColor(c);
//	while (1) {}	
	testIR();
//	testRGB();
    return 0;
}
